home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BBS in a Box 7
/
BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso
/
Files
/
Tele
/
R
/
RCMD Mover.cpt
/
Tips on using RCMD's!
< prev
next >
Wrap
Text File
|
1989-12-29
|
5KB
|
135 lines
Tips on using RCMD's...
by Robert A. Daniel
GEnie: B.DANIEL
_________________________________________________
What are RCMD's?
An RCMD (pronounced "are-command") allows adding extra features to White Knight
in the same way that an XCMD adds features to HyperCard. RCMD's can either
be a complete stand-alone utility such as "ProcEdit", a procedure editor that
is self-contained and runs its own environment or an RCMD can be a function
to the procedure language such as "Zero Out", a function that is used within
your procedure to change variables to zero. In effect, "Zero Out" is a WK
procedure command similar to ERASE.
Stand-alone RCMD's are usually contained in their own procedure. To use the
RCMD, you would call it with the NEST command.
RCMD Functions that add commands to the procedure language can be copied
into your procedure using "ResEdit" or a utility called "RCMD Mover"
(available for free in the FreeSoft Libraries on GEnie).
_________________________________________________
How to use RCMD's in your procedures.
There are 2 methods to call RCMD's.
Method 1:
A precompiled procedure containing an RCMD can be called from your own
procedure by using the NEST command.
Example:
NEST :Sound Player.PROC
The : in front of the file name is used when the procedure is in the same
folder as WK. After the procedure completes, execution will return to your
procedure.
This method is the standard way to call an RCMD but Method 2 is more direct
because the RCMD can be in the same file as your procedure thus execute
without branching to other procedures.
_________________
Method 2:
Before getting into Method 2, you need to be aware that this method involves
copying someone elses work into your procedure. If your use of the RCMD is
for more than just personal use, you may be infringing on the copyright
of the RCMD. If the RCMD is NOT public domain, you may need permission
from the author to use it.
In an RCMD procedure file, there is a resource identified by the
type 'RCMD' that is called by using White Knight's RCMD procedure command.
If this sounds confusing then read on...
Use the included RCMD procedure "Sound Player" which will play 'snd'
sounds in your procedures. If you open this procedure with ResEdit,
you'll see a resource labeled 'RCMD'. There are also resources labeled 'snd'
in the file. If you open the RCMD you'll see the ID number 299. This is the
number that will be used in your procedure to call the RCMD. If you copy the
RCMD to a procedure that you have created, you can then call it using
the RCMD command followed by the ID number:
RCMD 1,299
See the RCMD procedure syntax at the end of this document.
If the RCMD procedure contains windows, sounds, or other resources, you'll
need to copy those also. The "RCMD Mover" utility simplifies copying all
resources or just the RCMD itself. In the case of the "Sound Player", you
may want to copy All Resources if you want to play the sounds included.
Otherwise, you would copy 'snd's from other files into your procedure.
_________________________________________________
Questions and Answers about RCMDs:
Q: How do I know when to copy All Resources or just the RCMD?
A: If you don't know what each resource means, then you should copy all of
them. Some cases, you may want to include your own resources.
_________________
Q: Should I copy the resources into my source code of the procedure or in my
compiled procedure file?
A: You should copy the resources into your source code. When WK compiles
your source code, it will automically copy the RCMD's along with any other
resources into the compiled procedure.
_________________
Q: How many RCMD's can I have in a procedure?
A: You can copy as many RCMD's as you want in a single procedure as long as
each RCMD is identified with a unique ID number. If two RCMD's have the
same ID number, you can simply change one of the ID's in ResEdit using
Get Info.
_________________________________________________
RCMD Syntax (from the WK Development Kit Documentation)
RCMD num_exp1,num_exp2
Description: This command executes the RCMD whose resource ID number is
contained in num_exp2. The RCMD itself is contained in the resource fork of the
Procedure file. The parameter num_exp1 will be either 0 (zero) or 1 (one).
If the RCMD opens any windows or installs any menus, it must pass zero for
num_exp1. This tells White Knight to close its windows and deinstall its menus
before executing the RCMD. This is necessary because it would be impossible to
update or activate/deactivate any of White Knight's windows from within the
RCMD, and your RCMD would not know the present state of any of White Knight's
menus. When the RCMD completes, White Knight's windows and menus are
redisplayed as before. If your RCMD does not require any user input/output and
does not do any drawing, you can pass a 1 for num_exp1 and the RCMD will be
quite transparent to the user.
To Summarize;
num_exp1 should a zero (0) or one (1). Zero is used if the RCMD opens a
window or uses menus. One is used if the RCMD runs in the backround and
doesn't effect the WK window or menus.
num_exp2 is the ID number of the RCMD resource
_________________________________________________
Bob Daniel
GEnie Mail: B.DANIEL
AT&T Mail: attmail!cikpc!bob